package com.ct.gd.passport.view.passport;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.ct.gd.passport.R;
import com.ct.gd.passport.common.BaseActivity;
import com.ct.gd.passport.view.widget.CustomHeaderFragment;

public class PassportApp1Activity extends BaseActivity implements OnClickListener {

	private CustomHeaderFragment	mFgHeader;
    
    Button mAcceptBtn;
    Button mRejectBtn;
    
    @Override
	protected void onBaseCreate(Bundle savedInstanceState) {
		setContentView(R.layout.passport_app_1);
	}

	@Override
	protected void initViews() {
		
		mFgHeader = (CustomHeaderFragment) getSupportFragmentManager().findFragmentById(R.id.header);
		mFgHeader.setLeftView(null);
		mFgHeader.setCenterText(getString(R.string.passport_application));

		mRejectBtn = (Button)findViewById(R.id.btn_app1_reject);
		mAcceptBtn = (Button)findViewById(R.id.btn_app1_accept);
		
		mRejectBtn.setOnClickListener(this);
		mAcceptBtn.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		if(v.getId() == mRejectBtn.getId()){
			onReject();
		}
		if(v.getId() == mAcceptBtn.getId()){
			onAccept();
		}
	}
	
	private void onReject(){
		this.finish();
	}

	private void onAccept(){
		Intent intent = new Intent(this,PassportApp2Activity.class);
		startActivityForResult(intent, 0);
		finish();
	}
	
	@Override
	protected void onActivityResult(int arg0, int arg1, Intent arg2) {
		super.onActivityResult(arg0, arg1, arg2);
	}
}
